/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package FinancialEntity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Sebastian
 */
@Embeddable
public class StockPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "id")
    private int id;
    @Basic(optional = false)
    @Column(name = "Company_id")
    private int companyid;

    public StockPK() {
    }

    public StockPK(int id, int companyid) {
        this.id = id;
        this.companyid = companyid;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getCompanyid() {
        return companyid;
    }

    public void setCompanyid(int companyid) {
        this.companyid = companyid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) id;
        hash += (int) companyid;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StockPK)) {
            return false;
        }
        StockPK other = (StockPK) object;
        if (this.id != other.id) {
            return false;
        }
        if (this.companyid != other.companyid) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.StockPK[ id=" + id + ", companyid=" + companyid + " ]";
    }
    
}
